import request from '@/utils/request'

/* 查询文件列表 */
export const listFile = (params) => {
    return request({
        url: '/system/file/list',
        method: 'get',
        params: params
    })
}
/* 分页查询文件列表 */
export const pageFile = (params) => {
    return request({
        url: '/system/file/page',
        method: 'get',
        params: params
    })
}

/* 获取文件列表详细信息 */
export const getFile = (id) => {
    return request({
        url: `/system/file/${id}`,
        method: 'get'
    })
}
/* 文件上传 */
export const upload = (params) => {
    return request({
        url: '/system/file/upload',
        headers: { 'Content-Type': 'multipart/form-data' },
        method: 'post',
        data: params
    })
}
/* 删除文件 */
export const deleteFile = (id) => {
    return request({
        url: `/system/file/${id}`,
        method: 'delete'
    })
}